package ref;

import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.List;

import org.apache.log4j.Logger;

import util.XxlsData;

public class Tradeinfo implements XxlsData {
	private static Logger log = Logger.getLogger("Tradeinfo");
	public void dataType(PreparedStatement ps, List<String> rowlist) {
		try {
			for (int j = 0; j < rowlist.size(); j++) {
	        	switch (j) {
				case 0: 	ps.setString(1, rowlist.get(0).toString().trim());break;
				case 1: 	ps.setString(2, rowlist.get(1).toString().trim());break;
				case 2: 	ps.setString(3, rowlist.get(2).toString().trim());break;
				case 3: 	ps.setString(4, rowlist.get(3).toString().trim());break;
				case 4: 	ps.setInt(5, Integer.valueOf(rowlist.get(4).toString().trim()));break;
				case 5: 	ps.setString(6, rowlist.get(5).toString().trim());break;
				case 6: 	ps.setString(7, rowlist.get(6).toString().trim());break;
				case 7: 	ps.setString(8, rowlist.get(7).toString().trim());break;
				case 8: 	ps.setString(9, rowlist.get(8).toString().trim());break;
				case 9: 	ps.setString(10, rowlist.get(9).toString().trim());break;
				default: 	log.info(System.err);
				}
			}
		} catch (NumberFormatException e) {
			e.printStackTrace();
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}
}